#ifndef _SYS_OP_H
#define _SYS_OP_H
#include <linux/kernel.h>  // sprintf
#include <linux/security.h>
#include <linux/seq_file.h>
#include <linux/string.h>

#include "netctl_list.h"

#define LTCS_TRUSTED_DIR  "ltcs"
#define LTCS_TRUSTED_FILE "trusted_elf"

// struct dentry *ltcs_dir;
// struct dentry *ltcs_trusted_file;

void* ltcs_trusted_start(struct seq_file* m, loff_t* pos);

void* ltcs_trusted_next(struct seq_file* m, void* v, loff_t* pos);

void ltcs_trusted_stop(struct seq_file* m, void* v);

int ltcs_trusted_show(struct seq_file* m, void* v);

static const struct seq_operations ltcs_trusted_seqops = {
    .start = ltcs_trusted_start,
    .next  = ltcs_trusted_next,
    .stop  = ltcs_trusted_stop,
    .show  = ltcs_trusted_show,
};

int ltcs_trusted_open(struct inode* inode, struct file* file);

ssize_t ltcs_trusted_read(struct file* file, char __user* ubuf, size_t count,
                          loff_t* ppos);

ssize_t ltcs_trusted_write(struct file* file, const char __user* ubuf,
                           size_t count, loff_t* ppos);

static const struct file_operations ltcs_fops = {
    .open = ltcs_trusted_open, .write = ltcs_trusted_write, .read = seq_read,
    // .read = ltcs_trusted_read,
};

int ltcs_sysfs_init(void);

void ltcs_sysfs_free(void);

#endif /* _SYS_OP_H */
